package io.bloom.webspider;

import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.regex.Pattern;

@Data
public class SpiderRequest implements java.io.Serializable
{
    private String url;

    private int tryCount;

    private Date lastTime;

    private List<Pattern> patterns;

    public static SpiderRequest of(String url)
    {
        SpiderRequest request = new SpiderRequest();
        request.setUrl(url);
        return request;
    }

    public void incrTryCount()
    {
        tryCount++;
    }

}
